package com.qinghong.springcould.controller;

import com.qinghong.springcould.service.PaymentHystrixService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderHystirxController {

    @Resource
    private PaymentHystrixService paymentHystrixService;

    @GetMapping(value = "/consumer/payment/hystrix/ok/{id}")
    public String paymnentInfo_OK(@PathVariable("id") Integer id){
        String result = paymentHystrixService.paymnentInfo_OK(id);
        return result;
    }

    @GetMapping(value = "/consumer/payment/hystrix/timeout/{id}")
    public String paymnentInfo_TimeOut(@PathVariable("id") Integer id){
        String s = paymentHystrixService.paymnentInfo_TimeOut(id);
        return s;
    }
}
